﻿#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// GUI过滤枚举属性
/// </summary>
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public class ESF_GUISelectFilterEnumAttribute : PropertyAttribute
{
    /// <summary>
    /// GUI过滤枚举属性
    /// </summary>
    /// <param name="_enums">过滤枚举</param>
    public ESF_GUISelectFilterEnumAttribute(params Type[] _enums)
    {
        if (_enums != null)
        {
            List<Type> temp = new List<Type>();
            for (int index = 0; index < _enums.Length; index++)
            {
                if (!temp.Contains(_enums[index]))
                {
                    temp.Add(_enums[index]);
                }
            }
            types = temp.ToArray();
        }
    }

    /// <summary>
    /// 过滤枚举类型组
    /// </summary>
    public Type[] types { get; private set; }
}
#endif
